/*
 * SafeNumberList.h
 *
 *  Created on:  Jun 12, 2009
 *      Author:  Zach Riggle A37627537
 *      Project: CSE410 Project 2
 */

#ifndef SAFENUMBERLIST_H_
#define SAFENUMBERLIST_H_

#include <vector>
#include "LockedNumber.h"

using namespace std;

class SafeNumberList {
public:
    SafeNumberList();
    virtual ~SafeNumberList();

    void setList(vector<int> v);
    vector<int> getList();

    int size();

    void lock(int first, int second);
    void unlock(int first, int second);

    LockedNumber *operator[](int offset);
    LockedNumber *get(int offset);

    // Set to 1 if sorted.  Set to 0 if not sorted.
    LockedNumber sorted;
private:
    vector<LockedNumber*> numberList;
};

#endif /* SAFENUMBERLIST_H_ */
